﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DirectorateList.ascx.cs"
    Inherits="SD.Web.Controls.DirectorateList" %>

    <div class="titleh">
        <h3 class="sorting_range">
            <asp:LinkButton ID="LinkButtonAll" runat="server" CssClass="hg-blue" CommandName="1234567890qwertyuiopasdfghjklzxcvbnm"
                OnCommand="FilterByLetters_Command">All</asp:LinkButton>
            <asp:LinkButton ID="LinkButton09" runat="server" CommandName="0123456789" OnCommand="FilterByLetters_Command">0-9</asp:LinkButton>
            <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="abcde" OnCommand="FilterByLetters_Command">A B C D E</asp:LinkButton>
            <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="fghij" OnCommand="FilterByLetters_Command">F G H I J</asp:LinkButton>
            <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="klmn" OnCommand="FilterByLetters_Command">K L M N </asp:LinkButton>
            <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="opqr" OnCommand="FilterByLetters_Command">O P Q R</asp:LinkButton>
            <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="stuv" OnCommand="FilterByLetters_Command">S T U V</asp:LinkButton>
            <asp:LinkButton ID="LinkButtonWZ" CssClass="last" runat="server" CommandName="wxyz"
                OnCommand="FilterByLetters_Command">W X Y Z</asp:LinkButton>
            <span class="right">
                <asp:LinkButton ID="LinkButtonCreate" runat="server" CssClass="hg-blue" OnClick="LinkButtonCreate_Click">Create</asp:LinkButton>
                <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                    OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
            </span>
        </h3>
    </div>
    <asp:GridView ID="GridViewDirectorate" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
        AllowSorting="True" PageSize="10" OnSorting="GridViewDirectorate_Sorting" OnRowDataBound="GridViewDirectorate_RowDataBound">
        <Columns>
            <asp:TemplateField HeaderText="Name" SortExpression="DirectorateName">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButtonDIRName" runat="server" CommandName='<%# Eval("DirectorateId") %>'
                        OnCommand="LinkButtonDIRName_Command" CommandArgument='<%#Eval("IsActive") %>'
                        Text='<%# Eval("DirectorateName") %>'></asp:LinkButton>
                </ItemTemplate>
                <HeaderStyle CssClass="header" Width="133px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Office Address Line1" SortExpression="Address1">
                <ItemTemplate>
                    <%# Eval("AddressLine") %>
                </ItemTemplate>
                <HeaderStyle CssClass="header" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="PostCode" SortExpression="PostCode">
                <ItemTemplate>
                    <%# Eval("Postcode")%>
                </ItemTemplate>
                <HeaderStyle CssClass="header" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Contact" SortExpression="ContactName">
                <ItemTemplate>
                    <%# string.Format("{0} {1}", Eval("FirstName"), Eval("Surname")) %>
                </ItemTemplate>
                <HeaderStyle CssClass="header" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Is Active" SortExpression="IsActive">
                <ItemTemplate>
                    <%# (bool) Eval("IsActive") ? "Yes" : "No" %>
                </ItemTemplate>
                <HeaderStyle CssClass="header" />
            </asp:TemplateField>
        </Columns>
        <PagerStyle CssClass="pagination_table"></PagerStyle>
    </asp:GridView>
    <table style="margin-top: 10px; margin-left: 10px;">
        <tr style="line-height: 30px; padding: 20px 0;">
            <% if (btnFirst.Visible == true)
               { %>
            <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                    border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                    color: #3E7CAC; padding: 8px 0 8px 0;">
                    <asp:LinkButton ID="btnFirst" runat="server" OnClick="btnFirst_Click" Visible="false"
                        Height="30px" Width="40px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;"><<</span></asp:LinkButton>
                </span>
            </td>
            <%} %>
            <% if (btnPrevious.Visible == true)
               { %>
            <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                    border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                    color: #3E7CAC; padding: 8px 0 8px 0;">
                    <asp:LinkButton ID="btnPrevious" runat="server" OnClick="btnPrevious_Click" Height="30px"
                        Width="30px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;"><</span></asp:LinkButton>
                </span>
            </td>
            <%} %>
            <% if (btnNext.Visible == true)
               { %>
            <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                    border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                    color: #3E7CAC; padding: 8px 0 8px 0;">
                    <asp:LinkButton ID="btnNext" runat="server" OnClick="btnNext_Click" Height="30px"
                        Width="30px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;">></span></asp:LinkButton>
                </span>
            </td>
            <%} %>
            <% if (btnLast.Visible == true)
               { %>
            <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                    border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                    color: #3E7CAC; padding: 8px 0 8px 0;">
                    <asp:LinkButton ID="btnLast" runat="server" OnClick="btnLast_Click" Height="30px"
                        Width="40px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;">>></span></asp:LinkButton>
                </span>
            </td>
            <%} %>
        </tr>
    </table>
